package com.fhz.mvvmtest.food.view;

import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.ViewModelProviders;

import android.os.Bundle;

import com.fhz.mvvmtest.R;
import com.fhz.mvvmtest.food.entity.Food;
import com.fhz.mvvmtest.food.viewmodel.FoodViewModel;
import com.fhz.mvvmtest.food.viewmodel.FoodViewModelFactory;

/**
 * @author: fhz
 * @describe:
 * @date: 2021-11-15 13:32:10
 */

public class FoodActivity extends AppCompatActivity {

    private FoodViewModel foodViewModel;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_food);

        foodViewModel = ViewModelProviders.of(this, new FoodViewModelFactory()).get(FoodViewModel.class);
        Food food = foodViewModel.getFood();
//        System.out.println(food);

    }
}
